package org.example.pro1;

import org.example.pro1.service.StudentService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

import java.util.List;

@Import(MysqlConfig.class)
@ComponentScan
public class ApplicationTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(ApplicationTest.class);

        StudentService studentService = context.getBean(StudentService.class);
        List<Student> students = studentService.getAllStudents();

        students.forEach(System.out::print);

        context.close();
    }
}
